import sys, urllib2 
'''
headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'} 
req = urllib2.Request("https://www.baidu.com", headers=headers) 
content = urllib2.urlopen(req).read()   # UTF-8  
  
type = sys.getfilesystemencoding()      # local encode format  
print content.decode("UTF-8").encode(type)  # convert encode format 
'''
x=urllib2.urlopen('https://baidu.com/')
print x.read()
